package vip.liux.contracts.models.customer;

import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
import vip.liux.contracts.shared.enums.Gender;
import vip.liux.contracts.shared.enums.Status;
import vip.liux.domain.entities.auditing.AuditedEntity;

/**
 * C端客户基本信息表
 */
@Getter
@Setter
@Entity
@Table(name = "customer")
public class Customer extends AuditedEntity<Long> {
    /**
     * 客户唯一标识ID
     */
    @Column(name = "uid", nullable = false)
    private String uid;

    /**
     * 手机号
     */
    @Column(name = "mobile", nullable = false, length = 20)
    private String mobile;

    /**
     * 用户名
     */
    @Column(name = "username", nullable = false, length = 256)
    private String username;

    /**
     * 客户昵称
     */
    @Column(name = "nickname", nullable = false, length = 50)
    private String nickname;

    /**
     * 密码（加密存储）
     */
    @Column(name = "password", nullable = false, length = 100)
    private String password;

    /**
     * 头像地址
     */
    @Column(name = "avatar")
    private String avatar;

    /**
     * 性别 0-未知 1-男 2-女
     */
    @Column(name = "gender")
    @Enumerated(EnumType.ORDINAL)
    private Gender gender;

    /**
     * 状态 1-正常 0-禁用
     */
    @Column(name = "status")
    @Enumerated(EnumType.ORDINAL)
    private Status status;

    /**
     * 注册来源
     */
    @Column(name = "register_source", length = 30)
    private String registerSource;
}